import java.util.Random;
import java.util.Scanner;

/**
 * Created by dllo on 18/3/31.
 */
public class Question03 {
    public static void main(String[] args) {
        /*1. 用户有5000元
          2.用户输入大小(0-大,1*小)
          3生成三个  1-6  的随机数作为骰子
          4根据 点数和判断数据线大小
          5 根据点数大小,和用户输入的大小进行比较,如果一致,用户金额+50
          如果不一致,用户金额-50
          6用户没钱了,让它退出
          .循环2-6
          */
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();
        int money = 5000;
        while (money != 0) {
            System.out.println("输入大或者小" + "1是大,2是小"+":");
            int d = scanner.nextInt();// 压 大小
            int a = random.nextInt(6) + 1;//骰子1 范围1-6
            int b = random.nextInt(6) + 1;//骰子2
            int c = random.nextInt(6) + 1;//骰子3
            int sum = a + b + c;//大小实际结果
            System.out.println(a + "," + b + "," + c);
            if (sum < 10) {
                System.out.println(sum + ":" + "小");
            } else {
                System.out.println(sum + ":" + "大");
            }
            switch (d) {
                case 1:
                    if (sum >= 11 && sum <= 18) {
                        System.out.println("赢");
                        money += 5000;
                        System.out.println("剩余钱是" +money);
                    } else {
                        System.out.println("输");
                        money -= 5000;
                        System.out.println("剩余钱是" +money);
                    }
                    break;
                case 2:
                    if (sum >= 3 && sum <= 10) {
                        System.out.println("赢");
                        money += 5000;
                        System.out.println("剩余钱是" + money);
                    } else {
                        System.out.println("输");
                        money -= 5000;
                        System.out.println("剩余钱是" + money);
                    }
            }
        }
        System.out.println("请充值");
    }
}
